<template>
  <!-- MV列表 -->
  <div class="MvList">
    <div class="container" v-for="(item, index) in mvs" :key="index">
      <div class="image" @click="itemClick(item.id)">
        <img v-if="item.cover" v-lazy="item.cover" alt="" />
        <img v-else v-lazy="item.imgurl" alt="" />
        <div class="playcount">
          <i class="iconfont icon-bofang"></i>
          <span>{{ item.playCount | countFormat }}</span>
        </div>
        <div class="btn"><i class="iconfont icon-bofang"></i></div>
      </div>
      <p class="name">{{ item.name }}</p>
      <p class="creator">{{ item.artistName }}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: ['mvs'],

  data() {
    return {};
  },
  computed: {},
  created() {},
  components: {},
  methods: {
    itemClick(id) {
      this.$router.push('/videodetail/' + id).catch((error) => {});
    },
  },
};
</script>

<style scoped lang='scss'>
.MvList {
  display: grid;
  grid-template-columns: repeat(3, 250px);
  grid-gap: 22px;
  // justify-content: space-between;
  // flex-wrap: wrap;
  .container {
    font-size: 12px;
    .image {
      position: relative;
      img {
        width: 250px;
        height: 140px;
        border-radius: 5px;
        cursor: pointer;
      }
      .playcount {
        position: absolute;
        top: 5px;
        right: 5px;
        color: #fff;
        i {
          font-size: 12px;
        }
      }
      .btn {
        width: 30px;
        height: 30px;
        padding: 1px 0 0 2px;
        background-color: #fff;
        border-radius: 50%;
        position: absolute;
        right: 40%;
        bottom: 40%;
        text-align: center;
        line-height: 30px;
        opacity: 0;
        transition: all 1s;
        cursor: pointer;
        i {
          font-size: 17px;
          color: $themeColor;
        }
      }
      &:hover .btn {
        opacity: 1;
      }
    }
    .name {
      width: 250px;
      font-size: 14px;
      @include hidWord;
    }
  }
}
</style>